package test;

import dao.StaffsDao;
import dao.impl.StaffsDaoImpl4jdbc;
import entity.Staffs;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 *  修改
 * @Author lzp
 * @Date 2024-03-06
 */
public class test04 {
    public static void main(String[] args) {
        StaffsDao staffsDao = new StaffsDaoImpl4jdbc();

        String sqlAddTime = "2022-05-15 13:30:00";
        DateTimeFormatter sqlAddformatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime updateTime1 = LocalDateTime.parse(sqlAddTime, sqlAddformatter);

        String fixedTime = "2022-05-15 13:30:00";
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime updateTime = LocalDateTime.parse(fixedTime, formatter);

        Staffs s = new Staffs();

        s.setName("廖神");
        s.setAge(18);
        s.setPhone("22222222222");
        s.setPos("董事长");
        s.setAddTime(updateTime1);
        s.setUpdateTime(updateTime);
        s.setId(10);

        int row = staffsDao.update(s);
        System.out.println(row);
    }
}
